import { IsString, IsNumberString ,IsNotEmpty,Length, IsNumber, IsBoolean, isNumber} from 'class-validator';
import { ApiProperty} from '@nestjs/swagger';
import { MongodbId } from '../../common/common.dto';

/**新增用户的实体 */
export class AddUser {
	@ApiProperty({
		description:"用户名称"
	})
	@IsString()
	@IsNotEmpty()
	@Length(2,8)
	name: string;

	@ApiProperty({
		description:"用户头像"
	})
	@IsString()
	@IsNotEmpty({message:"请上传头像"})
	avatar: string;
}

/**编辑用户的实体 */
export class EditUser {
	@ApiProperty({
		description:"用户id"
	})
	@IsString()
	id: string;

	@ApiProperty({
		description:"用户名称"
	})
	@IsString()
	name: string;

	@ApiProperty({
		description:"用户头像"
	})
	@IsString()
	avatar: string;
}

/**删除用户的实体 */
export class UserId extends MongodbId{
	@ApiProperty({
		description:"用户id"
	})
	id: string;
}


